import { onMounted, onUnmounted } from 'vue'

export default function useBus(cb) {
  let off;
  onMounted(() => {
    off = cb()
  })

  onUnmounted(() => {
    off();
  })
}
